﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

namespace EHTWebsiteProject
{
    public partial class CustomerChangePassword : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnChange_Click(object sender, EventArgs e)
        {
            try
            {
                MembershipUser theUser = Membership.GetUser(HttpContext.Current.User.Identity.Name);
                theUser.ChangePassword(this.txtPasswordOld.Text.Trim(), this.txtPassword.Text.Trim());
                ltrMessageSuccess.Text = "Endre passord suksess";
                this.txtPasswordOld.Text = "";
                this.txtPassword.Text = "";
                this.txtConfirmPassword.Text = "";
            }
            catch (Exception ex)
            {
                ltrMessageFail.Text = "feil " + ex.Message;
            }
        }

        protected void btnCancel_Click1(object sender, EventArgs e)
        {
            Response.Redirect("Kundeprofil.html");
        } 
    }
}